package main

import (
	"sync"
	"time"

	"gitee.com/yanwc/license/pkg/validator"
)

func main() {
	t := validator.NewTimeValidator(&validator.Config{
		//	PublicKeyPEM: `-----BEGIN RSA PUBLIC KEY-----
		//
		// MIIBCgKCAQEAzxjS1d9jZPg/ek+OwPlb4ImTEU8stBNzj/DNgjk/Hzaw2T63EOk9
		// ew+w5W43IzstPZwewMrn3Zzc/G6Hd/NGpsDcNijOeoPJiABg74lr3JXEvg7su/BK
		// RT5FKoMwbU0m57XncBqPpjbBDUCtuOrO4CRouMPOdAjPMmmX3RmAE/NUCvcVxMUu
		// RThI42S7CSaaCe1uENQiUFiD/j5EX3Sb9i5DBDKFDdCwmQsoYejtuXzN4m1yHI8e
		// tamAs2cVrXa2Ea1dGQvEWfQFGqj3ZKHUZgthjkdU3v1uIBiJldQnqLUuHjlCYFd5
		// V4cvi7E5v8UbtuGGDlZPqX3RyzbSr4Lg9wIDAQAB
		// -----END RSA PUBLIC KEY-----`,
		PublicKeyPEM: "../cmd/generator/rsagenscript/pems/license_public_key.pem",
		LicensePath:  "../cmd/generator/licensegen/out/license.lic",
	})
	// err := t.SimpleValidate()
	// if err != nil {
	// 	return
	// }

	// u, err := t.Validate()
	// if err != nil {
	// 	panic(err)
	// }

	// fmt.Println(u)

	var g sync.WaitGroup
	g.Add(1)
	t.Setup(2*time.Minute, false)
	g.Wait()
}
